package com.jinke.api.modules.third.huaLei.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @projectName:
 * @title: TradeTypeEnum
 * @description:
 * @see:
 * @author: hhp
 * @version: 1.0.0
 * @createTime: 2024/8/29 14:23
 */
@Getter
public enum TradeType {

    SUMAI("SUMAI", "速脉ERP"),
    QQZS("QQZS", "全球助手"),
    WDJL("WDJL", "网店精灵"),
    IEBAY365("IEBAY365", "IEBAY365"),
    STOMS("STOMS", "赛兔OMS"),
    TTERP("TTERP", "通途ERP"),
    MGDZ("MGDZ", "芒果店长"),
    LRERP("LRERP", "懒人erp"),
    SUMOOL("SUMOOL", "速猫ERP"),
    GLBPAY("GLBPAY", "上海九赢"),
    DXM("DXM", "店小秘"),
    TEMU("TEMU", "拼多多推单"),
    ZYXT("ZYXT", "客户自用系统/其他不在列表中的均使用该代码");

    private final String code;
    private final String desc;

    TradeType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static TradeType getByCode(String code) {
        return Arrays.stream(TradeType.values()).filter(tradeType -> tradeType.getCode().equals(Optional.ofNullable(code).orElse(""))).findFirst().orElse(null);
    }
}
